﻿<h2>Manual Close Button</h2>
<p id="close-button-event">
    <CloseButton id="close-button" Clicked="@RaiseCounter" AutoClose="false">Count</CloseButton>
    <span id="close-button-event-result">@manualCounter</span>
</p>

<h2>Auto Close Button</h2>
<p id="autoclose-button-event">
    <Alert Visible="@autocloseAlertVisible" VisibleChanged="@AlertVisibleRaised">
        <CloseButton ElementId="autoclose-button" />
    </Alert>
    <span id="autoclose-button-event-result">@autoCounter</span>
</p>
@code{
    int manualCounter = 0;
    int autoCounter = 0;
    bool autocloseAlertVisible = true;

    void RaiseCounter()
    {
        manualCounter++;
    }

    void AlertVisibleRaised()
    {
        autocloseAlertVisible = false;
        autoCounter++;
    }
}